package net.lainiao.javademo.server.service;

import com.alibaba.dubbo.config.annotation.Service;
import net.lainiao.javademo.base.api.IDemoInfoService;
import net.lainiao.javademo.base.model.DemoInfo;
import net.lainiao.javademo.server.dao.DemoInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by Administrator on 2016/11/24.
 */
@Service
public class DemoInfoService implements IDemoInfoService {
    @Autowired
    DemoInfoMapper demoInfoMapper;
    @Override
    public DemoInfo getDemoInfo(int key) {
        return demoInfoMapper.selectByPrimaryKey(key);
    }

    @Override
    public int addDemoInfo(DemoInfo demoInfo) {
        return demoInfoMapper.insert(demoInfo);
    }

    @Override
    public int updateDemoInfo(DemoInfo demoInfo) {
        return demoInfoMapper.updateByPrimaryKey(demoInfo);
    }

    @Override
    public int deleteDemoInfo(int key) {
        return demoInfoMapper.deleteByPrimaryKey(key);
    }

    @Override
    public String getVersion() {
        return demoInfoMapper.getVersion();
    }
}
